/*
 * Copyright (c) 2016-present, Parse, LLC
 * All rights reserved.
 *
 * This source code is licensed under the license found in the LICENSE file in
 * the root directory of this source tree.
 */
@import 'stylesheets/globals.scss';

$headerHeight: 48px;
$menuSectionHeight: 24px;
$sidebarMenuItemHeight: 48px;
$footerHeight: 36px;

.sidebar {
  position: fixed;
  width: 300px;
  top: 0;
  left: 0;
  bottom: 0;
  background: #0c5582;
  color: #fff;
  transition: left 0.5s ease-in;
}

.toggle {
  position: fixed;
  border-radius: 5px;
  width: 28px;
  height: 28px;
  top: 10px;
  left: 310px;
  opacity: 0;
  transition: left 0.5s ease-in, opacity 0.5s 0.5s ease-in;
}

@media (max-width: 980px) {
  .sidebar {
    left: 0;
  }

  .toggle {
    left: 310px;
    top: 10px;
    opacity: 1;
  }

  body:global(.expanded) {
    .sidebar {
      left: -300px;
    }

    .toggle {
      left: 10px;
    }
  }
}

.content {
  position: absolute;
  overflow-y: auto;
  top: $headerHeight;
  right: 0;
  bottom: 36px;
  left: 0;
}

.apps + .content {
  top: $headerHeight + $sidebarMenuItemHeight;
}

.footer {
  @include NotoSansFont;
  position: absolute;
  background: #05283c;
  height: $footerHeight;
  line-height: 18px;
  padding: 9px 0;
  text-align: center;
  bottom: 0;
  left: 0;
  right: 0;

  a {
    color: white;
    text-decoration: none;
    border-right: 1px solid #385261;
    height: 18px;
    line-height: 18px;
    font-size: 13px;
    padding: 0 12px;
    vertical-align: top;

    &:first-child {
      padding-left: 0;
    }
    &:last-child {
      padding-right: 0;
      border: none;
    }
  }

  svg {
    margin-top: -2px;
  }
}

.header {
  background: #05283c;
  height: $headerHeight;
  padding: 10px 14px;

  :global(.icon) {
    width: 28px;
    height: 28px;
    float: left;
  }
}

.currentApp, .menuRow {
  @include ellipsis();
  display: block;
  background: #094162;
  height: $sidebarMenuItemHeight;
  padding: 10px 14px;

  color: white;
  font-size: 18px;
  font-weight: 700;
  line-height: 30px;
  cursor: pointer;
}

.menuRow {
  border-bottom: 1px solid #0c5582;

  > *:first-child {
    display: inline-block;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  > *:not(:first-child) {
    float: right;
  }
}

.currentApp {
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 40px;

  &:hover{
      &:after {
        border-top-color: white;
      }
  }

  &:after {
    @include arrow('down', 10px, 7px, #132B39);
    position: absolute;
    content: '';
    top: 20px;
    right: 15px;
  }
}

.appsMenu .currentApp:after {
  @include arrow('up', 10px, 7px, #ffffff);
  position: absolute;
  content: '';
  top: 20px;
  right: 15px;
}

.appsMenu {
  overflow: auto;
  background: #094162;
  width: 300px;

  .menuRow:hover {
    background: #0c5582;
  }

  .appListContainer {
    overflow-y: auto;
    height: calc(100vh - #{$headerHeight} - #{$menuSectionHeight} - #{$sidebarMenuItemHeight} - #{$footerHeight});
  }
}

.menuSection {
  @include DosisFont;
  height: $menuSectionHeight;
  line-height: 24px;
  background: #0c5582;
  color: #84A5BC;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 8px;
  padding: 0 14px;
  border-bottom: 1px solid #094162;
}

.createApp {
  @include DosisFont;
  display: block;
  background: $blue;
  color: white;
  width: 91%;
  height: 30px;
  line-height: 30px;
  border-radius: 5px;
  text-align: center;
  margin: 12px auto;
  font-size: 12px;

  &:hover {
    background: #0c5582;
  }
}

.section {
  background: #0c5582;

  :global(.icon) {
    margin-right: 14px;
  }
}

.active {
  background: #159cee;

  .section_header{
    font-weight: 700;
    &:hover{
      background: #159cee;
    }
  }
}

.section_header {
  display: block;
  height: $sidebarMenuItemHeight;
  font-size: 18px;
  line-height: 28px;
  padding: 12px 14px;
  color: white;

  &:hover{
    background-color: #0D5E91;
  }

  > span {
    vertical-align: top;
  }

  > svg {
    margin-right: 14px;
  }
}

.section_contents {
  background: #0e69a0;
  padding: 16px 14px 16px 50px;
}

.subitem {
  position: relative;
  height: 28px;
  line-height: 28px;
  font-size: 16px;
  font-weight: 700;
  color: white;
}

a.subitem {
  color: #8fb9cf;
  font-weight: 400;
  display: inline-block;
  width: 100%;

  &:hover {
    color: white;
  }
}

.action {
  @include DosisFont;
  position: absolute;
  font-size: 12px;
  font-weight: 400;
  padding: 0 8px;
  line-height: 20px;
  top: 4px;
  right: 0px;
  background: #0c5987;
  color: white;
  border-radius: 3px;

  &:hover {
    background: #094162;
  }
}

.logo {
  float: left;
}

.version {
  @include DosisFont;
  position: relative;
  width: 75px;
  height: 100%;
  font-size: 10px;
  float: left;
  margin-left: 6px;
  white-space: nowrap;
  color: white;

  > *:first-child {
    position: absolute;
    letter-spacing: 2px;
    line-height: 10px;
    text-transform: uppercase;
  }

  > *:first-child {
    top: 10px;
    transition: all 0.4s 0.16s cubic-bezier(0.77, 0, 0.175, 1);
  }
}

.more {
  svg {
    fill: #0C5582;
    transition: fill 0.2s ease-in;
  }

  &:hover {
    svg {
      fill: $blue;
    }
  }
}

.popup {
  position: absolute;
  bottom: 4px;
  left: -183px;
  background: white;
  width: 200px;
  border-radius: 5px;

  &:after {
    @include arrow('down', 12px, 6px, #ffffff);
    content: '';
    position: absolute;
    bottom: -6px;
    right: 11px;
  }

  a {
    @include NotoSansFont;
    display: block;
    height: 30px;
    line-height: 31px;
    font-size: 13px;
    text-align: right;
    border-bottom: 1px solid #e0e0ea;
    color: $mainTextColor;
    padding-right: 8px;
    &:hover{
      background-color: darken(white,4%)
    }

    &:first-child {
      border-radius: 5px 5px 0 0;
    }

    &:last-child {
      border-bottom: 0;
      border-radius: 0 0 5px 5px;
    }

    .emoji{
      padding-left: 4px;
      padding-right: 2px;
    }
  }
}
